/*    */ package com.lmpop.frame.util;
/*    */ 
/*    */ import java.io.PrintStream;
/*    */ import java.text.Collator;
/*    */ import java.util.ArrayList;
/*    */ import java.util.Collections;
/*    */ import java.util.Comparator;
/*    */ import java.util.List;
/*    */ import java.util.Locale;
/*    */ 
/*    */ public class PinyinComparator
/*    */   implements Comparator
/*    */ {
/*    */   public int compare(Object o1, Object o2)
/*    */   {
/* 12 */     Comparator cmp = Collator.getInstance(Locale.CHINA);
/* 13 */     return cmp.compare(o1.toString(), o2.toString());
/*    */   }
/*    */ 
/*    */   public static void main(String[] args) {
/* 17 */     List list = new ArrayList();
/* 18 */     list.add("北京");
/* 19 */     list.add("上海");
/* 20 */     list.add("常州");
/* 21 */     Collections.sort(list, new PinyinComparator());
/* 22 */     System.out.println(list.toString());
/*    */   }
/*    */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.frame.util.PinyinComparator
 * JD-Core Version:    0.6.0
 */